description = "Testcontainers :: Neo4j"

def generatedResourcesDir = new File(project.buildDir, "generated-resources")
def customNeo4jPluginDestinationDir = new File(generatedResourcesDir, "custom-plugins")

sourceSets {
    customNeo4jPlugin {
        java {
            srcDir 'src/custom-neo4j-plugin'
        }
    }
    test {
        resources {
            srcDir generatedResourcesDir
        }
    }
}

task customNeo4jPluginJar(type: Jar) {
    from sourceSets.customNeo4jPlugin.output
    archiveFileName = "hello-world.jar"
    destinationDirectory = customNeo4jPluginDestinationDir

    inputs.files(sourceSets.customNeo4jPlugin.java.srcDirs)
    outputs.cacheIf { true }
    outputs.dir(customNeo4jPluginDestinationDir)
}

processTestResources.dependsOn customNeo4jPluginJar

dependencies {
    customNeo4jPluginCompileOnly "org.neo4j:neo4j:3.5.35"

    api project(":testcontainers")

    testImplementation 'org.neo4j.driver:neo4j-java-driver:4.4.16'
    testImplementation 'org.assertj:assertj-core:3.25.3'
}
